<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       var fruit =prompt('请输入你要查询的水果');
       switch (fruit) {
           case '苹果':
               alert('三块钱一斤');
               break;

            case '梨子':
            alert('四块钱一斤');
               break;

            case '香蕉':
            alert('2块钱一斤');   
               break;
            case '葡萄':
            alert('三块五钱一斤');
               break;


       
           default:
            alert('我们这没有这种水果抱歉哦！');
               break;
       }
    </script>
</body>
</html>